
clc; clear; close all;

%Generates summary statistics for the CIP runs and outputs them in a
%workspace in the output folder

load('intermediate\CompileAllCIPCalcs.mat');

%% CIP 
SumStatsCIP    = zeros(5,5);
RowHeadingsCIP = {'AUD/USD','GBP/USD','CAD/USD','EUR/USD','JPY/USD'};
ColHeadingsCIP = {'Mean', 'Standard Deviation', 'P10','Median','P90'};

%Run through each currency and store the values in the appropriate row and
%column based on the row headings and column headings hard coded above

counter = 0;
while(counter<5)
   counter = counter + 1;
   SumStatsCIP(counter,:)=[mean(CIPCalcsAll(:,counter)) std(CIPCalcsAll(:,counter)) prctile(CIPCalcsAll(:,counter),10) prctile(CIPCalcsAll(:,counter),50) prctile(CIPCalcsAll(:,counter),90)];
end

%% Microstructure

ColHeadingsCME = RowHeadingsCIP;
RowHeadingsCME = {'Min Price','Mean Price','Max Price','Avg Daily Dollar Volume','10P Daily Volume','Median Daily Volume','90P Daily Volume','# Transactions/Day'}';

SumStatsCME = valsForSumStats2;

save('intermediate\summary_stats_CIP','SumStatsCIP','ColHeadingsCIP','RowHeadingsCIP');
save('intermediate\summary_stats_CME','SumStatsCME','ColHeadingsCME','RowHeadingsCME');

Row1Bloomberg = {'3M T Bills','3M EUR German','3M AUD','3M CAD','3M GBP LIBOR','3M JPY LIBOR','EUR/USD Spot','EUR 3M Forward Points','AUD/USD Spot','AUD 3M Forward Points','CAD/USD Spot','CAD 3M Forward Points','GBP/USD Spot','GBP 3M Forward Points','JPY/USD Spot','JPY 3M Forward Points'};
Row2Bloomberg = {'GB03 Govt','GTDEM3MO Corp','ADBB3M CMPN Curncy','CDOR03 Index','BP0003M','JY0003M Index','EUR BGN Curncy','EUR3M BGN Curncy','AUD BGN Curncy','AUD3M BGN Curncy','CAD BGN Curncy','CAD3M BGN Curncy','GBP BGN Curncy','GBP3M BGN Curncy','JPY BGN Curncy','JPY3M BGN Curncy'};

save('intermediate\BloombergDataRetrieval','Row1Bloomberg','Row2Bloomberg');